﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BingZi.HY.Core;
using NewLife.Web;
using System.Collections;

namespace FrameWork.web
{
    public partial class help : BaseTemplatePage
    {

        #region "==属性=="

        private Int32 HelpID = WebHelper.GetIntParam(HttpContext.Current.Request, "HelpID", 0);

        private String HelpName = WebHelper.GetStringParam(HttpContext.Current.Request, "HelpName", "");

        #endregion

        #region "==方法=="

        /// <summary>
        /// 绑定页面元素
        /// </summary>
        private void BindPageItem()
        {

            Hashtable puts = new Hashtable();

            app_Help HelpItem = new app_Help();

            if (HelpID > 0)
            {
                HelpItem = app_Help.FindByKeyForEdit(HelpID);
            }
            else if (!String.IsNullOrEmpty(HelpName))
            {
                HelpItem = app_Help.Find(app_Help._.H_Name, HelpName);
                if (HelpItem == null || HelpItem.HelpID == 0)
                {
                    HelpItem = new app_Help();
                    HelpItem.HelpID = 1;
                    HelpItem.H_Name = HelpName;
                    HelpItem.H_Description = String.Format("{0} 还没有相关的描述信息", HelpName);
                }
            }

            if (HelpItem != null && HelpItem.HelpID > 0)
            {

                puts.Add("HelpItem", HelpItem);
                puts.Add("HelpID", HelpID);
                puts.Add("HelpName", HelpName);


                //HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Write(ViewTemplate(EnumTemplateFile.Help, puts));
                //HttpContext.Current.Response.Flush();
                //HttpContext.Current.Response.End();
            }
            else
            {
 
            }

        }

        #endregion

        #region "==事件=="


        /// <summary>
        /// 页面加载
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {

                if (!IsPostBack)
                {

                    //绑定页面元素
                    BindPageItem();

                }
            }
            catch (Exception ex)
            {

            }

        }




        #endregion





    }
}